package com.github.kassadin.kotlinandroid

/**
 *
 * Created by <b>kassadin@foxmail.com</b> on 16/1/22 16:51
 */
data class RecentWeathersResp(val errNum: Int, val  errMsg: String, val retData: RetData)

data class RetData(val city: String, val cityid: String, val today: Today, var  forecast: List<Forecast> = emptyList(), var history: List<History> = emptyList())

data class History(val date: String, val  week: String, val  aqi: String, val fengxiang: String, val  fengli: String, val hightemp: String, val lowtemp: String, val type: String)

data class Forecast(val date: String, val week: String, val  fengxiang: String, val fengli: String, val  hightemp: String, val lowtemp: String, val type: String)

data class Today(val date: String, val week: String, val curTemp: String, val aqi: String, val fengxiang: String, val fengli: String, val hightemp: String, val lowtemp: String, val  type: String, val  index: List<Index>)

data class Index(val name: String, val code: String, val index: String, val details: String, val otherName: String)

fun RetData.getIndexCount(): Int = today.index.size
fun RetData.getForecastCount(): Int = forecast.size
fun RetData.getItemCount(): Int = 1 + getIndexCount() + getForecastCount()






